import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '../views/layout'

Vue.use(VueRouter)

const routes = [
  { path: '/login', name: 'login', component: _ => import('@/views/login') },
  {
    path: '/',
    component: Layout,
    children: [
      { path: '', name: 'home', component: _ => import('@/views/home') },
      { path: '/goods', name: 'goods', component: _ => import('@/views/goods') }
    ]
  }
]

const router = new VueRouter({
  routes
})

export default router
